<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>{$site_name}</title>
<!-- CSS -->
<link rel="stylesheet" href="{url:#css/materialize.min.css}" />
<link rel="stylesheet" href="{url:#css/me.css}" />
<link rel="stylesheet" href="{url:#css/iconfont.css}" />

<style type="text/css">
/**去除绿色下划线 - 开始*/
input::-webkit-input-placeholder {
    color: #7e7e7e;
    text-indent: 5px;
}
input:not([type]),input[type=text],input[type=password],input[type=email],input[type=url],input[type=time],input[type=date],input[type=datetime-local],input[type=tel],input[type=number],input[type=search],textarea.materialize-textarea{background-color:transparent;border:none;border-radius:0;outline:none;height:1.5em;width:100%;font-size:1rem;margin:0;padding:0;box-shadow:none;}
input:not([type]):focus:not([readonly]),input[type=text]:focus:not([readonly]),input[type=password]:focus:not([readonly]),input[type=email]:focus:not([readonly]),input[type=url]:focus:not([readonly]),input[type=time]:focus:not([readonly]),input[type=date]:focus:not([readonly]),input[type=datetime-local]:focus:not([readonly]),input[type=tel]:focus:not([readonly]),input[type=number]:focus:not([readonly]),input[type=search]:focus:not([readonly]),textarea.materialize-textarea:focus:not([readonly]){border-bottom:none;box-shadow:none}
/**去除绿色下划线 - 结束*/
</style>
<!-- JS -->
<script src="{url:#js/jquery-1.11.3.min.js}"></script>
<script src="{url:#js/materialize.min.js}"></script>
<script src="{url:#js/home/register.js}"></script>
<script src="{url:#js/yang_check.js}"></script>


</head>
<body>
<!-- TitleBar 开始 -->
<div class="navbar-fixed">
  <nav>
    <div class="nav-wrapper red accent-4 valign-wrapper">
      <ul class="left" id="nav-btn-left">
        <li><a><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
      <span class="title-bar-size center_align">个人资料</span>
      <ul class="right">
        <li><a  class="disabled" style="visibility:hidden"><i class="iconfont">&#xe63c;</i></a></li>
      </ul>
    </div>
  </nav>
</div>

<!-- TitleBar 结束 -->

<div class="container">
	<div class="reg-box">
	<table>
		 
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		<tr>
			<td class="ltitle">会员账号</td>
			<td>{$mobile_user['name']}</td>
		</tr>
		
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		<tr>
			<td class="ltitle">推广编码</td>
			<td>{$mobile_user['number']}</td>
		</tr>
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		<tr>
			<td class="ltitle" style="width:28%">真实姓名</td>
			<td><input name="real_name" id="real_name" type="text" placeholder="请输入真实姓名" value="{$mobile_user['real_name']}"/></td>
		</tr>
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		<tr>
			<td class="ltitle">开户银行</td>
			<td><input name="bank" id="bank" type="text" placeholder="请输入开户银行" value="{$mobile_user['bank']}"/></td>
		</tr>
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		
		<tr>
			<td class="ltitle">银行卡号</td>
			<td><input name="bank_kh" id="bank_kh" type="text" placeholder="请输入银行卡号" value="{$mobile_user['bank_kh']}"/></td>
		</tr>
		<tr><td colspan="2"><div class="divider"></div></td></tr>
		
		
		
		
	</table>
	</div>
	<div class="center clearfix" style="margin-right:10px; margin-left:10px;margin-top:20px;">
		
		<input type="button" id="btn_reg" class="waves-effect waves-light btn-large red z-depth-0 login_btn" value="保&nbsp;&nbsp;存"/>
	</div>
</div>

<script type="text/javascript">


$(function(){
	
	$("#btn_reg").click(function()
	{
		//推荐编码
		var real_name     = $.trim( $("#real_name").val() );
		var bank          = $.trim( $("#bank").val() );
		var bank_kh      = $.trim( $("#bank_kh").val() );
		
		if(real_name == '')
		{
			yang_alert('真实姓名不能为空');
			return;
		}
		
		if(bank == '')
		{
			yang_alert('开户银行不能为空');
			return;
		}
		
		if(bank_kh == '')
		{
			yang_alert('银行卡号不能为空');
			return;
		}
		
		//$("#btn_reg").unbind('click');
		$("#btn_reg").attr('disabled', true);
		$.post('{url:/mobile/info_save}',{real_name:real_name,bank:bank,bank_kh:bank_kh},function(data){
	        if(data['status']=='success')
		    {
			    yang_alert('操作成功');
			    //个人中心页面
	            document.location.href = document.location.href;
	        }
	        else
		    {
	            yang_alert(data['msg']);
	            $("#btn_reg").attr('disabled', false);
	            //document.location.href="{url:/mobile/login}";
	        }
	      },'json');
		
		
	});
});


function get_validate_code()
{
	var mobile = $.trim($("#uname").val());
	if(mobile == '')
	{
		yang_alert('手机号码不能为空');
		return;
	}
	//var mobile_pattern = /^1[3-9]\d{9}$/;
	var mobile_pattern = /^((1[3-9]\d{9})|(\d{14}))$/;
	if(!mobile_pattern.test(mobile))
	{
		yang_alert('手机号码不合法');
		return;
	}
	
	$("#btn_get_validate").attr("disabled", true);
	$.post("{url:/simple/sms_send}",{mobile:mobile},function(result){
	      yang_alert(result);
	      $("#btn_get_validate").attr("disabled", false);
	  });
}


</script>

</body>
</html>
